home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mission 3
/
Mission 3.zip
/
Mission 3.iso
/
tools
/
facevalu
/
examples
/
ex
/
userwork.lst
< prev
Wrap
File List
|
1998-04-04
|
70KB
|
1,708 lines
> PROCEDURE open_text_window
LOCAL handle&,index& !locals
LET handle&=@textlist_win_open(" System font at 10 points ","",0,3,window_menu&,42,-1,-1,-1,-1,iconify_icon_1&,txt%,txt$())
IF handle&>0 !if window opened
index&=@win_get_index(handle&) !find index
num_fonts&=@vdi_load_fonts(window_array&(index&,22)) !load fonts
' these are the extended window_array&() entries:
window_array&(index&,26)=1 !initial font id
window_array&(index&,27)=10 !initial font size
@textlist_resize(index&,txt%,txt$())
ENDIF
RETURN
> PROCEDURE change_font(index&)
LOCAL id&,size&,wcell&,hcell&,ret%,x&,y&,w&,h&,name$,handle&,fontflags&
IF index&=-1 !if called by shortcut
~WIND_GET(0,10,handle&,d&,d&,d&) !get the top window (the window whose shortcut was used)
index&=@win_get_index(handle&) !find <index&> for this window
ENDIF
id&=window_array&(index&,26) !find font id
size&=window_array&(index&,27) !find font size
'
' 1=include systemfont
' 2=include monospaced
' 4=include proportional
' 8=include bitmap
' 240=include vector
' 254=include all
fontflags&=254 !include all
'
ret%=@xfsl(window_array&(index&,22),"Choose font",fontflags&,num_fonts&,name$,id&,size&,wcell&,hcell&)
IF ret%=1 !if new font/size selected
@win_set_title(index&," "+name$+" "+STR$(size&)+" points ") !set title of window
' then fill the extended window_array&() entries correctly:
window_array&(index&,26)=id& !new font id
window_array&(index&,27)=size& !new font size
' update the window:
@textlist_resize(index&,txt%,txt$())
@win_send_redraw(index&,-1,-1,-1,-1) !redraw window
ENDIF
RETURN
'
' delete the (other) doubled routines:
> PROCEDURE user_rsc_var_init
'
' You MUST set these variables (and DIMension any listbox arrays here).
' This is read ONCE, at startup, and the corresponding dialog objects
' will be set accordingly.
'
current_menubar&=menu& !set this to the menu bar tree index
' current_menubar&=window_menu& !set this to the menu bar tree index
'
' snap_windows!=TRUE
animate_background_alert!=TRUE
animate_sound_off!=FALSE
'
LET ob_check3_var!=FALSE ! TRUE/FALSE - tree: checks&
LET ob_check4_var!=FALSE ! TRUE/FALSE - tree: checks&
LET ob_check5_var!=FALSE ! TRUE/FALSE - tree: checks&
LET ob_check6_var!=FALSE ! TRUE/FALSE - tree: checks&
LET ob_check1_var!=FALSE ! TRUE/FALSE - tree: checks&
LET ob_check2_var!=FALSE ! TRUE/FALSE - tree: checks&
LET radio1_var&=1 ! Min=1/Max=2 - tree: radios&
LET a_radio1_var&=1 ! Min=1/Max=3 - tree: radios&
LET t_pen_trpvar&=1 ! Min=1/Max=6 - tree: radios&
LET t_pen_var&=1 ! Min=1/Max=6 - tree: radios&
LET t_spray_var&=1 ! Min=1/Max=3 - tree: radios&
LET t_line_var&=1 ! Min=1/Max=8 - tree: radios&
LET t_shape_var&=1 ! Min=1/Max=16 - tree: radios&
LET t_bezier_var&=1 ! Min=1/Max=5 - tree: radios&
LET t_circle_var&=1 ! Min=1/Max=10 - tree: radios&
LET nscroll_var$="-98" ! Min=-98/Max=98 - tree: input&
LET nscroll_edit_var$="-98" ! Min=-98/Max=98 - tree: input&
LET numeric_var$="" ! Max lenght: 6 - tree: input&
LET text_only_var$="" ! Max lenght: 8 - tree: input&
LET callback_var$="" ! Max lenght: 8 - tree: input&
LET show_callback_var$="" ! Max lenght: 8 - tree: input&
LET img_rpop_var&=1 ! Min=1/Max=48 - tree: popups&
LET txt_rpop_var&=1 ! Min=1/Max=9 - tree: popups&
LET sa_disppop_var&=1 ! Min=1/Max=3 - tree: popups&
'
DIM radio_lstbox_arr$(19) ! you decide - tree: listbxes&
LET radio_lstbox_ndx&=20 ! number of entries - tree: listbxes&
LET radio_lstbox_var&=1 ! the selected option - tree: listbxes&
DIM checl_lstbox_arr$(19) ! you decide - tree: listbxes&
DIM checl_lstbox_arr!(19) ! you decide - tree: listbxes&
LET checl_lstbox_ndx&=20 ! number of entries - tree: listbxes&
DIM menu_lstbox_arr$(19) ! you decide - tree: listbxes&
LET menu_lstbox_ndx&=20 ! number of entries - tree: listbxes&
DIM open_listbox1_arr$(19) ! you decide - tree: listbxes&
LET open_listbox1_ndx&=20 ! number of entries - tree: listbxes&
LET open_listbox1_scrl&=0 ! the initial scroll position
DIM open_lstbox2_arr$(19) ! you decide - tree: listbxes&
LET open_lstbox2_ndx&=20 ! number of entries - tree: listbxes&
LET open_lstbox2_var&=1 ! the selected option - tree: listbxes&
LET open_lstbox2_scrl&=0 ! the initial scroll position
DIM open_lstbox3_arr$(19) ! you decide - tree: listbxes&
DIM open_lstbox3_arr!(19) ! you decide - tree: listbxes&
LET open_lstbox3_ndx&=20 ! number of entries - tree: listbxes&
LET open_lstbox3_scrl&=0 ! the initial scroll position
'
b&=65
FOR a&=0 TO 19
radio_lstbox_arr$(a&)=CHR$(b&)+" Radio "+STR$(a&+1)
checl_lstbox_arr$(a&)=CHR$(b&)+" Check "+STR$(a&+1)
menu_lstbox_arr$(a&)=CHR$(b&)+" Menu "+STR$(a&+1)
LET open_listbox1_arr$(a&)="Menu "+STR$(a&+1)
LET open_lstbox2_arr$(a&)="Radio "+STR$(a&+1)
LET open_lstbox3_arr$(a&)="Check "+STR$(a&+1)
INC b&
NEXT a&
'
LET open_lstbox3_ndx&=7 ! number of entries - tree: listbxes&
LET open_lstbox3_scrl&=0 ! the initial scroll position
LET mstate1_var&=1 ! Min=1/Max=3 - tree: mstate&
LET mstate4_var&=1 ! Min=1/Max=3 - tree: mstate&
LET mstate2_var&=1 ! Min=1/Max=4 - tree: mstate&
LET mstate3_var&=1 ! Min=1/Max=6 - tree: mstate&
LET sa_freqpop_var&=1 ! Min=1/Max=4 - tree: toolstrip&
LET sa_zoompop_var&=1 ! Min=1/Max=9 - tree: toolstrip&
LET toolbar_radios_var&=1 ! Min=1/Max=4 - tree: toolbar&
LET prg_modal_var&=1 ! Min=1/Max=3 - tree: menu&
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
' slidemover(index&,object&,display&,min&,max&,chars&,flag!)
@slidemover_set(input&,slider&,slider&,10,0,127,3,TRUE)
' @fvw_set_slidemover(input&,slider&,slider&,10,0,127,3,TRUE)
'
RETURN
> PROCEDURE user_rsc_interact(index&,tree&,object&,mc&,sub_me&)
'
' <index&> is the index of this window in window_array&(index&,x)
' If the object tree is the normal menu bar, <index&>=-1
' <tree&> is the object tree number
' <object&> is the object that was selected (clicked on OR shortcut)
' <mc&> is the number of clicks (1=normal/2=double clicked/1 if shortcut)
' <sub_me&> is the chosen menuitem in a popup menu
'
SELECT tree&
'
' ------------------------------------------------------------------------
'
CASE buttons&
SELECT object&
CASE button1&
@messagewin_print("You have pressed 'button1&' (exit)")
CASE button2&
@messagewin_print("You have pressed 'button2' (touchexit)")
CASE close_buttons&
@messagewin_print("Closing the 'Button' dialog")
@win_close(@find_handle_from_tree(tree&))
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE checks&
SELECT object&
CASE ob_check1&
@messagewin_print("The value of 'ob_check1_var!' is now "+STR$(ob_check1_var!))
CASE ob_check2&
@messagewin_print("The value of 'ob_check2_var!' is now "+STR$(ob_check2_var!))
CASE ob_check3&
@messagewin_print("The value of 'ob_check3_var!' is now "+STR$(ob_check3_var!))
CASE ob_check4&
@messagewin_print("The value of 'ob_check4_var!' is now "+STR$(ob_check4_var!))
CASE ob_check5&
@messagewin_print("The value of 'ob_check5_var!' is now "+STR$(ob_check5_var!))
CASE ob_check6&
@messagewin_print("The value of 'ob_check6_var!' is now "+STR$(ob_check6_var!))
CASE check_close&
@messagewin_print("Closing the 'Status objects' dialog")
@win_close(@find_handle_from_tree(tree&))
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE radios&
SELECT object&
'
'
CASE radios_close&
@messagewin_print("Closing the 'Radio objects' dialog")
@win_close(@find_handle_from_tree(tree&))
CASE t_pen&
@messagewin_print("The value of 't_pen_var&' is now "+STR$(t_pen_var&))
@messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
CASE t_spray&
@messagewin_print("The value of 't_spray_var&' is now "+STR$(t_spray_var&))
@messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
CASE t_line&
@messagewin_print("The value of 't_line_var&' is now "+STR$(t_line_var&))
@messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
CASE t_shape&
@messagewin_print("The value of 't_shape_var&' is now "+STR$(t_shape_var&))
@messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
CASE t_bezier&
@messagewin_print("The value of 't_bezier_var&' is now "+STR$(t_bezier_var&))
@messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
CASE t_circle&
@messagewin_print("The value of 't_circle_var&' is now "+STR$(t_circle_var&))
@messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
CASE radio1&
@messagewin_print("The value of 'radio1_var&' is now "+STR$(radio1_var&))
CASE radio2&
@messagewin_print("The value of 'radio1_var&' is now "+STR$(radio1_var&))
CASE a_radio1&
@messagewin_print("The value of 'a_radio1_var&' is now "+STR$(a_radio1_var&))
CASE a_radio2&
@messagewin_print("The value of 'a_radio1_var&' is now "+STR$(a_radio1_var&))
CASE a_radio3&
@messagewin_print("The value of 'a_radio1_var&' is now "+STR$(a_radio1_var&))
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE input&
SELECT object&
CASE nscroll&
@messagewin_print("The value of 'nscroll_var$' is now "+nscroll_var$)
CASE slider&
a&=@slidemover(index&,slider&,slider&,0,127,3,TRUE)
IF sub_me&<>-10
@messagewin_print("The SlideMover reports a value of "+STR$(a&))
ENDIF
CASE nscroll_edit&
@messagewin_print("The value of 'nscroll_edit_var$' is now "+nscroll_edit_var$)
CASE callback&
@rsc_set_text(tree&,show_callback&,callback_var$)
@rsc_ob_draw(index&,show_callback&)
CASE input_close&
@messagewin_print("Closing the 'Input objects' dialog")
@win_close(@find_handle_from_tree(tree&))
CASE text_only&
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE popups&
SELECT object&
CASE img_rpop&
@messagewin_print("The value of 'img_rpop_var&' is now "+STR$(img_rpop_var&))
CASE img_mpop&
@messagewin_print("Menu option "+STR$(sub_me&)+" of the 'img_popup' was selected")
CASE txt_rpop&
@messagewin_print("The value of 'txt_rpop_var&' is now "+STR$(txt_rpop_var&))
CASE txt_mpop&
@messagewin_print("Menu option "+STR$(sub_me&)+" of the 'txt_mpop' was selected")
CASE sa_disppop&
@messagewin_print("The value of 'sa_disppop_var&' is now "+STR$(sa_disppop_var&))
CASE popup_close&
@messagewin_print("Closing the 'Popups' dialog")
@win_close(@find_handle_from_tree(tree&))
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE listbxes&
SELECT object&
CASE radio_lstbox&
LET radio_lstbox_var&=@listbox_radio(index&,object&,radio_lstbox_var&,radio_lstbox_ndx&,radio_lstbox_arr$())
@messagewin_print("The value of 'radio_lstbox_var&' is now "+STR$(radio_lstbox_var&))
CASE checl_lstbox&
@listbox_list(index&,object&,checl_lstbox_ndx&,checl_lstbox_arr$(),checl_lstbox_arr!())
@messagewin_print("The content of the 'checl_lstbox_arr!()' array may have changed")
CASE menu_lstbox&
a&=@listbox_menu(index&,object&,menu_lstbox_ndx&,menu_lstbox_arr$())
@messagewin_print("Menu option "+STR$(a&)+" of the 'menu_lstbox' was selected")
CASE open_listbox1&
a&=@open_listbox_menu(index&,sub_me&,object&,open_listbox1_ndx&,open_listbox1_arr$(),open_listbox1_scrl&)
@messagewin_print("Menu option "+STR$(a&)+" of the 'open_listbox1' was selected")
SELECT a&
CASE 0
CASE 1
CASE 2
CASE 3
ENDSELECT
CASE open_lstbox2&
LET open_lstbox2_var&=@open_listbox_radio(index&,sub_me&,object&,open_lstbox2_var&,open_lstbox2_ndx&,open_lstbox2_arr$(),open_lstbox2_scrl&)
@messagewin_print("The value of 'open_lstbox2_var&' is now "+STR$(open_lstbox2_var&))
CASE open_lstbox3&
@open_listbox_list(index&,sub_me&,object&,open_lstbox3_ndx&,open_lstbox3_arr$(),open_lstbox3_arr!(),open_lstbox3_scrl&)
@messagewin_print("The content of the 'open_lstbox3_arr!()' array may have changed")
CASE lstbox_close&
@messagewin_print("Closing the 'Listbox objects' dialog")
@win_close(@find_handle_from_tree(tree&))
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE mstate&
SELECT object&
CASE mstate1&
@messagewin_print("The value of 'mstate1_var&' is now "+STR$(mstate1_var&))
CASE mstate4&
@messagewin_print("The value of 'mstate4_var&' is now "+STR$(mstate4_var&))
CASE mstate2&
@messagewin_print("The value of 'mstate2_var&' is now "+STR$(mstate2_var&))
CASE mstate3&
@messagewin_print("The value of 'mstate3_var&' is now "+STR$(mstate3_var&))
CASE mstate_close&
@messagewin_print("Closing the 'Multistate objects' dialog")
@win_close(@find_handle_from_tree(tree&))
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE other&
SELECT object&
CASE misc_drag&
@messagewin_print("The object 'misc_move&' was dropped on a window. Handle: "+STR$(sub_me&))
CASE misc_move&
IF mc&=2
@messagewin_print("The object 'misc_move&' was doubleclicked")
ENDIF
CASE misc_close&
@messagewin_print("Closing the 'Other objects' dialog")
@win_close(@find_handle_from_tree(tree&))
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE resize_me&
SELECT object&
CASE resize_close&
@messagewin_print("Closing the 'Resizeable' dialog")
@win_close(@find_handle_from_tree(tree&))
DEFAULT
@messagewin_print("The 'Resizeable' dialog was resized")
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE foldable&
SELECT object&
CASE foldable_close&
@messagewin_print("Closing the 'Foldable' dialog")
@win_close(@find_handle_from_tree(tree&))
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE toolstrip&
SELECT object&
CASE sa_freqpop&
CASE sa_zoompop&
CASE toolstrip_open&
CASE sa_play_dma&
CASE toolstrip_save&
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE menu&
SELECT object&
CASE about&
~@alert_wind(1,fv_copyright&,"")
CASE demo_quit&
exit_program!=TRUE
CASE m_buttons&
~@win_open_dialog(prg_modal_var&,buttons&,iconify_icon_1&)
CASE m_status&
~@win_open_dialog(prg_modal_var&,checks&,iconify_icon_1&)
CASE m_radios&
~@win_open_dialog(prg_modal_var&,radios&,iconify_icon_1&)
CASE m_input&
~@win_open_dialog(prg_modal_var&,input&,iconify_icon_1&)
CASE m_popups&
~@win_open_dialog(prg_modal_var&,popups&,iconify_icon_1&)
CASE m_listboxes&
~@win_open_dialog(prg_modal_var&,listbxes&,iconify_icon_1&)
CASE m_multistate&
~@win_open_dialog(prg_modal_var&,mstate&,iconify_icon_1&)
CASE m_resize&
~@win_open_dialog(prg_modal_var&,resize_me&,iconify_icon_1&)
CASE m_foldable&
~@win_open_dialog(prg_modal_var&,foldable&,iconify_icon_1&)
CASE m_other&
~@win_open_dialog(prg_modal_var&,other&,iconify_icon_1&)
CASE menu_ascii&
~@win_open_dialog(4,fvt_asci&,-1)
CASE menu_alerts&
IF @alert_wind(1,alert_1&,"")=1
~@alert_wind(1,alert_3&,"")=1
ENDIF
CASE menu_progress&
@progress_open("New: Title!",-1) !user added
FOR albert&=0 TO 4000 !user added
EXIT IF @progress_update(INT(albert&/40)) !user added
NEXT albert& !user added
@progress_close !user added
CASE menu_busy&
time&=@busy_open(TRUE) !user added
FOR a&=0 TO 4000 !user added
EXIT IF @busy_update(time&) !user added
NEXT a& !user added
@busy_close !user added
CASE demo_simple_win&
~@win_open(" Standard window "," Info line...",simple_window%,backgrnd&,800,800,16,16,12,0,0,800,800,iconify_icon_1&)
CASE demo_hor_tlstrip&
~@win_open(" Toolstrip window ","",toolstrip_window%,toolstrip&,800,800,16,16,12,0,0,800,800,iconify_icon_1&)
CASE demo_ver_toolbar&
~@win_open(" Toolbar window ","",toolbar_window%,toolbar&,800,800,16,16,12,0,0,800,800,iconify_icon_1&)
CASE demo_menu_window&
@open_text_window
CASE iconify_all&
@win_iconify_all
CASE uniconify_all&
@win_uniconify_all
CASE menu_help&
' @call_st_guide("EXAMPLE.HYP","Menu") !*****calls menu help page
@call_st_guide("EXAMPLE.HYP","") !*****calls main (content) page
CASE menu_gen_help&
' @call_st_guide("EXAMPLE.HYP","Menu") !*****calls menu help page
@call_st_guide("EXAMPLE.HYP","") !*****calls main (content) page
CASE prg_modal&
CASE non_modal&
CASE toolbox_modal&
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE window_menu&
SELECT object&
CASE font_selector&
@change_font(index&)
CASE test&
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE fvt_altr&
alert_result&=SUB(object&,7)
@win_close(@find_handle_from_tree(fvt_altr&))
'
' ------------------------------------------------------------------------
'
'
CASE tear_off&
'
@popup_win_do(index&,tree&,object&,mc&,sub_me&)
'
' ------------------------------------------------------------------------
'
CASE t_pens&
'
@popup_win_do(index&,tree&,object&,mc&,sub_me&)
'
' ------------------------------------------------------------------------
'
CASE t_sprays&
'
@popup_win_do(index&,tree&,object&,mc&,sub_me&)
'
' ------------------------------------------------------------------------
'
CASE t_lines&
'
@popup_win_do(index&,tree&,object&,mc&,sub_me&)
'
' ------------------------------------------------------------------------
'
CASE t_shapes&
'
@popup_win_do(index&,tree&,object&,mc&,sub_me&)
'
' ------------------------------------------------------------------------
'
CASE t_beziers&
'
@popup_win_do(index&,tree&,object&,mc&,sub_me&)
'
' ------------------------------------------------------------------------
'
CASE t_rshapes&
'
@popup_win_do(index&,tree&,object&,mc&,sub_me&)
'
' ------------------------------------------------------------------------
'
'
' ⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧ FV-Update ⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
ENDSELECT
RETURN
> PROCEDURE user_on_open
'
' This procedure is called when the program is run, after the RSC is
' loaded and just before the main loop. You can open program windows,
' toolboxes etc. here, or init things for your program like
' loading an *.INF or .DAT file.
'
' If run as an accessory, this procedure is called EVERY TIME
' THE ACCESSORY IS OPENED. If you need to do anything just ONCE,
' like disable menu-entries spesific to PROGRAM execution, set a global
' flag here to avoid doing things EVERY time the accessory is opened.
'
LOCAL num_lines&,file$
'
IF dimmed!=FALSE !to avoid reloading when run as acc...
num_lines&=250
DIM txt$(num_lines&),txt!(num_lines&)
dimmed!=TRUE
LET file$="EX.TXT"+CHR$(0)
LET fh&=GEMDOS(61,L:V:file$,0)
IF fh&=>0
LET txt%=MAX(1,@fread_to_array(fh&,-1,txt$()))
ELSE
LET txt%=0
ENDIF
WHILE txt%>0
EXIT IF TRIM$(txt$(PRED(txt%)))<>""
DEC txt%
WEND
ENDIF
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
@messagewin_open(" Messagewindow ",50,200,20,400,180,iconify_icon_1&) !ΩΩFVW:messagewinΩΩ
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
'
RETURN
> PROCEDURE user_win_close_all
'
' This procedure is called when the WIN_CLOSE_ALL procedure of the FV engine
' is called, and before the windows are closed and the window arrays erased.
'
' If you have any resources attatched to each window, you can clean them
' up here. (releasing memory etc.)
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
@messagewin_close !ΩΩFVW:messagewinΩΩ
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
LOCAL a& !locals
FOR a&=0 TO max_number_windows& !check all windows
IF window_array&(a&,0)>0 !if the handle is valid
IF window_array&(a&,1)=0 !if a user window
IF window_array&(a&,8)=42 !if userhandle=42 (set when opened)
@vdi_unload_fonts(window_array&(a&,22)) !unload fonts
ENDIF
ENDIF
ENDIF
NEXT a&
'
RETURN
> PROCEDURE user_window_content(index&,userhandle&,off_x%,off_y%,cx&,cy&,cw&,ch&)
~GRAF_MOUSE(256,0) !hidem - to avoid "mousedroppings"
'
' This procedure is called when a user window needs to be redrawn.
' ALL of the window content should be drawn here. The x & y offsets
' will be automatically updated by the system and are ALWAYS current.
' DO NOT alter the clipping rectangle, it is set (walking the
' rectangle list) BEFORE calling this procedure.
'
' All your coordinates should be relative to the upper left of
' the work area of the window, except for blitting wich is relative
' to the upper left of the screen. If the window is scrollable/has sliders,
' subtract <off_x&> from ALL x-coordinates and <off_y&> from ALL
' y-coordinates.
'
' <index&> is the index of this window in window_array&(index&,x)
' <userhandle&> is the userhandle you gave when opening the window
' <off_x&> is the x offset of the window contents
' <off_y&> is the y offset of the window contents
' <cx&>,<cy&>,<cw&>,<ch&> is the clipping rectangle set
'
' window_array&(index&,22)=vdi handle for this window or <=0 if none
'
LOCAL a&
SELECT userhandle&
CASE 12
FOR a&=95 TO 395 STEP 100
CIRCLE 400-off_x%,400-off_y%,a&
NEXT a&
ENDSELECT
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' The following wrinkle-code is new, since you have updated:
IF userhandle&=viewer_userhandle_& !ΩΩFVW:fileviewerΩΩ
@textlist_draw(index&,off_x%,off_y%,cx&,cy&,cw&,ch&,viewer_entries_%,viewer_$(),viewer_selected_!()) !ΩΩFVW:fileviewerΩΩ
ENDIF !ΩΩFVW:fileviewerΩΩ
IF userhandle&=messagewin_userhandle_& !ΩΩFVW:messagewinΩΩ
@textlist_draw(index&,off_x%,off_y%,cx&,cy&,cw&,ch&,messagewin_entries_%,messagewin_$(),messagewin_selected_!()) !ΩΩFVW:messagewinΩΩ
ENDIF !ΩΩFVW:messagewinΩΩ
' --------------------------------------------------------------------------- !ΩΩFVW:textlistΩΩ
' Textlist-Wrinkle: (©1997 by Holger Herzog) !ΩΩFVW:textlistΩΩ
' !ΩΩFVW:textlistΩΩ
' Draw your textlists here. Just call textlist_draw like it is described in !ΩΩFVW:textlistΩΩ
' wrinkle_info. !ΩΩFVW:textlistΩΩ
' !ΩΩFVW:textlistΩΩ
SELECT userhandle& !ΩΩFVW:textlistΩΩ
CASE 42
@textlist_draw(index&,off_x%,off_y%,cx&,cy&,cw&,ch&,txt%,txt$(),txt!())
ENDSELECT !ΩΩFVW:textlistΩΩ
'
~GRAF_MOUSE(257,0) !showm - display pointer again
RETURN
> PROCEDURE user_keyb(handle&,userhandle&,index&,ks&,key&)
'
'
' To help you get going:
'
' scancode : BYTE(SHR(key&,8))
' ascii value : BYTE(key&)
' IF AND(ks&,&X11) : shift key pressed (either one)
' IF BTST(ks&,2) : control key pressed
' IF BTST(ks&,3) : alternate key pressed
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
RETURN
> FUNCTION user_win_close_ok(index&,userhandle&)
$F%
'
' User wants to close the userwindow in <index&>
' <userhandle&> is the userhandle you gave when opening the window
' Return value: TRUE to close window
' FALSE to ignore close call
'
' The code in this function is just an example. If you want to use an
' alert, you may (should?:-) want to use a windowed alert...
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' The following wrinkle-code is new, since you have updated:
IF userhandle&=viewer_userhandle_& !ΩΩFVW:fileviewerΩΩ
@viewer_close !ΩΩFVW:fileviewerΩΩ
RETURN TRUE !ΩΩFVW:fileviewerΩΩ
ENDIF !ΩΩFVW:fileviewerΩΩ
IF userhandle&=messagewin_userhandle_& !ΩΩFVW:messagewinΩΩ
@messagewin_close !ΩΩFVW:messagewinΩΩ
RETURN TRUE !ΩΩFVW:messagewinΩΩ
ENDIF !ΩΩFVW:messagewinΩΩ
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
IF userhandle&=42 !if textwindow (userhandle set when opened)
@vdi_unload_fonts(window_array&(index&,22)) !unload fonts
ENDIF
'
' SELECT FORM_ALERT(1,"[1][Really close? ][ OK |Cancel]")
' CASE 1
RETURN TRUE
' CASE 2
' RETURN FALSE
' ENDSELECT
'
ENDFUNC
> PROCEDURE user_textlist_dragdrop(source&,dest&,dx&,dy&)
'
' written on 25.09.1996 by Holger Herzog
'
' Version 1.1
'
' This procedure is called if the user has moved one or a few entries
' of a textlist-window by drag and drop. Be advised that source- and
' destinationwindow could be same.
'
' source& ==> FV-Index of source-window
' dest& ==> FV-Index of destination-window
' dx&, dy& ==> position (in pixels) where the user has
' dopped the entries (realtive to the left
' upper corner of the destination-window)
'
' Version 1.0 27.09.1996 Holger Herzog
' Version 1.1 29.03.1997 Holger Herzog
' Docu now in english :-)
'
' LOCAL source_handle&,source_userhandle&
' LOCAL dest_handle&,dest_userhandle&
' LOCAL off_x&,off_y&
'
' LET source_handle&=window_array&(source&,0)
' LET source_userhandle&=window_array&(source&,8)
' LET dest_handle&=window_array&(dest&,0)
' LET dest_userhandle&=window_array&(dest&,8)
' LET off_x&=window_array&(dest&,10)
' LET off_y&=window_array&(dest&,11)
'
'
RETURN
> PROCEDURE user_rsc_context_help(tree&)
SELECT tree&
CASE buttons&
@call_st_guide("EXAMPLE.HYP","Button objects")
CASE checks&
@call_st_guide("EXAMPLE.HYP","Status objects")
CASE radios&
@call_st_guide("EXAMPLE.HYP","Radio objects")
CASE input&
@call_st_guide("EXAMPLE.HYP","Input objects")
CASE popups&
@call_st_guide("EXAMPLE.HYP","Pop Ups")
CASE listbxes&
@call_st_guide("EXAMPLE.HYP","Listboxes")
CASE mstate&
@call_st_guide("EXAMPLE.HYP","Multiple state")
CASE other&
@call_st_guide("EXAMPLE.HYP","Misc. objects")
CASE resize_me&
@call_st_guide("EXAMPLE.HYP","Sizeable dialog")
CASE foldable&
@call_st_guide("EXAMPLE.HYP","Foldable")
CASE toolstrip&
@call_st_guide("EXAMPLE.HYP","Toolstrip")
CASE toolbar&
@call_st_guide("EXAMPLE.HYP","Toolbar")
CASE menu&
@call_st_guide("EXAMPLE.HYP","Menu")
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
DEFAULT
@call_st_guide("EXAMPLE.HYP","")
ENDSELECT
RETURN
> PROCEDURE user_var_index
' ap_id& : application id
' menu_id& : id for menu_register()
' acc! : running as an accessory
' exit_program! : quits program when set to TRUE
' commandline$ : the commandline the prg was started with (empty if acc)
' forced_exit! : system shutdown flag
' menubar_adress% : rsc adress of current menu bar
' current_menubar& : tree number of current menu bar
' current_menutitle& : menu title in @menu_selected,-1 if not in @menu_selected
' compiled! : GFA: compiled
' multitasking! : multitasking OS
' program_path$ : the path the program was launched from
' rsc_path_name$ : path & name of RSC-file (".\DATA\EX.RSC")
' max_number_windows& : maximum number of allowed windows
' window_array_size& : size of window_array&() elements per window
' windowtree_array_size& : size of window_tree%() elements per window
' iconify_method& : 0=disabled/1=internal/2=ICFS/3=MultiTOS
' ARRAY window_array&(x,y) : array for window/dialog info
' ARRAY window_tree%(x,y) : array for tree adresses/title/infoadress of windows
' ARRAY iconify!() : handles for iconification without ICFS
' progress_handle& : handle of progress indicator/0 if no indicator
' menu_disabled! : menu titles disabled for modal dialogs
' no_w_topping! : no window topping allowed while modal dialog
' top_modal& : the index of the top modal dialog, -1 if none
' fv_aes_lock_num& : used as a safeguard for the aes_(un)lock_screen routines
' ARRAY message&() : used in redrawing windows/calling ST-Guide
' num_prgdef_objects& : number of prgdef objects in RSC
' flydials_handle& : virtual workstation handle for GFA Flydials
' last_tree& : last object tree in RSC
' system_pool% : adress of system memory malloced for the interface
' prgdef_adress% : prgdef object memory adress
' st_guide% : memory adress of 256 byte block for interfacing with ST-Guide
' alert_result& : button clicked in alert
' return_value& : the return value of the program
' gem_through& : flag for letting *all* GEM messages through to @user_gem_messages() if >0
' fv_malloced% : variable used to keep track of memory allocation
' fv_malloced2% : variable used to keep track of memory allocation
' animate_background_alert! : allow backround window alert icon animation if set
' animate_sound_off! : turn animated animations` sound off
' animation_timer% : for kernel use if busy dialog is used
' no_rsc_found$ : alert string if the RSC connot be found
' not_accessory$ : alert string if run as acc not allowed
' systemcheck_alert$ : alert string it systemcheck is not ok
' snap_windows! : snap edge of window to word boundary (horisontal)
' gdos_minimum& : GDOS program requirement as set in FrontEnd
' fv_aes_timer& : used for evnt_multi to make timer events possible
' ARRAY fvrc_evnt&() : used for evnt_multi to make rectangle events possible
'
' ---------------------------------------------------------------------------
' OBJECT TREE NAMES:
' system& :dialog
' arrow& :dialog
' animcheck2& :dialog
' smiley& :dialog
' state_3& :dialog
' state_4& :dialog
' state_6& :dialog
' switch& :dialog
' animbut& :dialog
' tear_off& :dialog
' pause& :dialog
' t_pens& :dialog
' t_sprays& :dialog
' t_lines& :dialog
' t_shapes& :dialog
' t_beziers& :dialog
' t_rshapes& :dialog
' horisontal& :dialog
' buttons& :dialog
' checks& :dialog
' radios& :dialog
' input& :dialog
' popups& :dialog
' listbxes& :dialog
' mstate& :dialog
' other& :dialog
' resize_me& :dialog
' foldable& :dialog
' toolstrip& :dialog
' toolbar& :dialog
' menu& :menu
' window_menu& :menu
' fvt_popu& :dialog
' fvt_lsbx& :dialog
' fvt_prog& :dialog
' fvt_asci& :dialog
' fvt_altr& :dialog
' iconify_icon_1& :dialog
' backgrnd& :dialog
' fvt_alst& :dialog
' fvt_alic& :dialog
' fvt_work& :dialog
' fvt_maus& :dialog
' fvt_strt& :dialog
' ---------------------------------------------------------------------------
' OBJECT NAMES:
' button1& :object in tree buttons&
' button2& :object in tree buttons&
' close_buttons& :object in tree buttons&
' ob_check3& :object in tree checks&
' ob_check4& :object in tree checks&
' ob_check5& :object in tree checks&
' ob_check6& :object in tree checks&
' ob_check1& :object in tree checks&
' ob_check2& :object in tree checks&
' check_close& :object in tree checks&
' radio1& :object in tree radios&
' radio2& :object in tree radios&
' a_radio1& :object in tree radios&
' a_radio2& :object in tree radios&
' a_radio3& :object in tree radios&
' radios_close& :object in tree radios&
' t_pen& :object in tree radios&
' t_spray& :object in tree radios&
' t_line& :object in tree radios&
' t_shape& :object in tree radios&
' t_bezier& :object in tree radios&
' t_circle& :object in tree radios&
' nscroll& :object in tree input&
' slider& :object in tree input&
' nscroll_edit& :object in tree input&
' numeric& :object in tree input&
' text_only& :object in tree input&
' callback& :object in tree input&
' show_callback& :object in tree input&
' input_close& :object in tree input&
' img_rpop& :object in tree popups&
' img_mpop& :object in tree popups&
' txt_rpop& :object in tree popups&
' txt_mpop& :object in tree popups&
' popup_close& :object in tree popups&
' sa_disppop& :object in tree popups&
' radio_lstbox& :object in tree listbxes&
' checl_lstbox& :object in tree listbxes&
' menu_lstbox& :object in tree listbxes&
' open_listbox1& :object in tree listbxes&
' open_lstbox2& :object in tree listbxes&
' open_lstbox3& :object in tree listbxes&
' lstbox_close& :object in tree listbxes&
' mstate1& :object in tree mstate&
' mstate4& :object in tree mstate&
' mstate2& :object in tree mstate&
' mstate3& :object in tree mstate&
' mstate_close& :object in tree mstate&
' misc_drag& :object in tree other&
' misc_move& :object in tree other&
' misc_close& :object in tree other&
' resize_close& :object in tree resize_me&
' foldable_close& :object in tree foldable&
' sa_freqpop& :object in tree toolstrip&
' sa_zoompop& :object in tree toolstrip&
' toolstrip_open& :object in tree toolstrip&
' sa_play_dma& :object in tree toolstrip&
' toolstrip_save& :object in tree toolstrip&
' toolbar_radios& :object in tree toolbar&
' toolbar_sel& :object in tree toolbar&
' about& :object in tree menu&
' demo_quit& :object in tree menu&
' prg_modal& :object in tree menu&
' non_modal& :object in tree menu&
' toolbox_modal& :object in tree menu&
' m_buttons& :object in tree menu&
' m_status& :object in tree menu&
' m_radios& :object in tree menu&
' m_input& :object in tree menu&
' m_popups& :object in tree menu&
' m_listboxes& :object in tree menu&
' m_multistate& :object in tree menu&
' m_resize& :object in tree menu&
' m_foldable& :object in tree menu&
' m_other& :object in tree menu&
' menu_ascii& :object in tree menu&
' menu_alerts& :object in tree menu&
' menu_progress& :object in tree menu&
' menu_busy& :object in tree menu&
' demo_simple_win& :object in tree menu&
' demo_hor_tlstrip& :object in tree menu&
' demo_ver_toolbar& :object in tree menu&
' demo_menu_window& :object in tree menu&
' iconify_all& :object in tree menu&
' uniconify_all& :object in tree menu&
' menu_help& :object in tree menu&
' menu_gen_help& :object in tree menu&
' test& :object in tree window_menu&
' font_selector& :object in tree window_menu&
' sinus& :object in tree fvt_popu&
' sawtooth& :object in tree fvt_popu&
' square& :object in tree fvt_popu&
' alert_1& :object in tree fvt_alst&
' alert_3& :object in tree fvt_alst&
' fv_copyright& :object in tree fvt_alst&
' globemaus& :object in tree fvt_maus&
' macbusymouse& :object in tree fvt_maus&
'
' ---------------------------------------------------------------------------
' YOUR VARIABLES: (see PROCEDURE user_rsc_var_init for details)
'
' ob_check3_var! :animated switch in tree checks&
' ob_check4_var! :animated switch in tree checks&
' ob_check5_var! :animated switch in tree checks&
' ob_check6_var! :animated switch in tree checks&
' ob_check1_var! :selectable in tree checks&
' ob_check2_var! :selectable in tree checks&
' radio1_var& :radio button set in tree radios&
' a_radio1_var& :animated radiobutton set in tree radios&
' t_pen_trpvar& :Toolbox radio popup set in tree radios&
' t_pen_var& :Toolbox radio popup in tree radios&
' t_spray_var& :Toolbox radio popup in tree radios&
' t_line_var& :Toolbox radio popup in tree radios&
' t_shape_var& :Toolbox radio popup in tree radios&
' t_bezier_var& :Toolbox radio popup in tree radios&
' t_circle_var& :Toolbox radio popup in tree radios&
' nscroll_var& :numberscroller in tree input&
' nscroll_edit_var& :numberscroller in tree input&
' numeric_var$ :editable text in tree input&
' text_only_var$ :editable text in tree input&
' callback_var$ :editable text in tree input&
' show_callback_var$ :f(box)text (not editable) in tree input&
' img_rpop_var& :radio popup in tree popups&
' txt_rpop_var& :radio popup in tree popups&
' sa_disppop_var& :radio popup in tree popups&
' radio_lstbox_arr$ :listbox text array in tree listbxes&
' radio_lstbox_ndx& :listbox num entries in tree listbxes&
' radio_lstbox_var& :listbox radio in tree listbxes&
' checl_lstbox_arr$ :listbox text array in tree listbxes&
' checl_lstbox_ndx& :listbox num entries in tree listbxes&
' checl_lstbox_arr! :checklistbox flag array in tree listbxes&
' menu_lstbox_arr$ :listbox text array in tree listbxes&
' menu_lstbox_ndx& :listbox num entries in tree listbxes&
' open_listbox1_arr$ :open listbox text array in tree listbxes&
' open_listbox1_ndx& :open listbox num entries in tree listbxes&
' open_listbox1_scrl& :open listbox scroll value in tree listbxes&
' open_lstbox2_arr$ :open listbox text array in tree listbxes&
' open_lstbox2_ndx& :open listbox num entries in tree listbxes&
' open_lstbox2_var& :open listbox radio in tree listbxes&
' open_lstbox2_scrl& :open listbox scroll value in tree listbxes&
' open_lstbox3_arr$ :open listbox text array in tree listbxes&
' open_lstbox3_arr! :open listbox flag array in tree listbxes&
' open_lstbox3_ndx& :open listbox num entries in tree listbxes&
' open_lstbox3_scrl& :open listbox scroll value in tree listbxes&
' mstate1_var& :multistate button in tree mstate&
' mstate4_var& :multistate button in tree mstate&
' mstate2_var& :multistate button in tree mstate&
' mstate3_var& :multistate button in tree mstate&
' sa_freqpop_var& :radio popup in tree toolstrip&
' sa_zoompop_var& :radio popup in tree toolstrip&
' toolbar_radios_var& :radio button set in tree toolbar&
' prg_modal_var& :menuRadioItem set in tree menu&
'
' ---------------------------------------------------------------------------
' WINDOW TYPES:
' toolstrip_window%
' toolbar_window%
' menu_in_window%
' simple_window%
'
'
' ---------------------------------------------------------------------------
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' viewer_userhandle_& : userhandle of the fileviewer-window !ΩΩFVW:fileviewerΩΩ
' viewer_windowhandle_& : internal (fileviewer-wrinkle) !ΩΩFVW:fileviewerΩΩ
' viewer_$() : internal (fileviewer-wrinkle) !ΩΩFVW:fileviewerΩΩ
' viewer_selected_!() : internal (fileviewer-wrinkle) !ΩΩFVW:fileviewerΩΩ
' viewer_maxlines_% : internal (fileviewer-wrinkle) !ΩΩFVW:fileviewerΩΩ
' viewer_entries_% : internal (fileviewer-wrinkle) !ΩΩFVW:fileviewerΩΩ
' viewer_dragdrop_! : internal (fileviewer-wrinkle) !ΩΩFVW:fileviewerΩΩ
' messagewin_userhandle_& : userhandle of the messagewin-window !ΩΩFVW:messagewinΩΩ
' messagewin_windowhandle_& : internal (messagewin-wrinkle) !ΩΩFVW:messagewinΩΩ
' messagewin_$() : internal (messagewin-wrinkle) !ΩΩFVW:messagewinΩΩ
' messagewin_selected_!() : internal (messagewin-wrinkle) !ΩΩFVW:messagewinΩΩ
' messagewin_maxline_% : internal (messagewin-wrinkle) !ΩΩFVW:messagewinΩΩ
' messagewin_entries_% : internal (messagewin-wrinkle) !ΩΩFVW:messagewinΩΩ
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
RETURN
> FUNCTION user_rsc_bubble_help$(tree&,object&)
LOCAL help_str$
help_str$=""
'
' To enter a bubble help text for an object, simply write
' help_str$="My help text"like this into its CASE entry
' (directly below it). If you do not want bubble help for
' a given object, just delete its CASE entry...
'
' Example:
' SELECT tree&
' CASE my_dialog&
' SELECT object&
' CASE my_object&
' help_str$="Here is my example help text...!"
' ENDSELECT
' ENDSELECT
'
SELECT tree&
CASE tear_off&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE t_pens&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE t_sprays&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE t_lines&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE t_shapes&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE t_beziers&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE t_rshapes&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE buttons&
SELECT object&
CASE button1&
help_str$=""
CASE button2&
help_str$=""
CASE close_buttons&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE checks&
SELECT object&
CASE ob_check3&
help_str$=""
CASE ob_check4&
help_str$=""
CASE ob_check5&
help_str$=""
CASE ob_check6&
help_str$=""
CASE ob_check1&
help_str$=""
CASE ob_check2&
help_str$=""
CASE check_close&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE radios&
SELECT object&
CASE radio1&
help_str$=""
CASE radio2&
help_str$=""
CASE a_radio1&
help_str$=""
CASE a_radio2&
help_str$=""
CASE a_radio3&
help_str$=""
CASE radios_close&
help_str$=""
CASE t_pen&
help_str$=""
CASE t_spray&
help_str$=""
CASE t_line&
help_str$=""
CASE t_shape&
help_str$=""
CASE t_bezier&
help_str$=""
CASE t_circle&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE input&
SELECT object&
CASE nscroll&
help_str$=""
CASE slider&
help_str$=""
CASE nscroll_edit&
help_str$=""
CASE numeric&
help_str$=""
CASE text_only&
help_str$=""
CASE callback&
help_str$=""
CASE show_callback&
help_str$=""
CASE input_close&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE popups&
SELECT object&
CASE img_rpop&
help_str$=""
CASE img_mpop&
help_str$=""
CASE txt_rpop&
help_str$=""
CASE txt_mpop&
help_str$=""
CASE popup_close&
help_str$=""
CASE sa_disppop&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE listbxes&
SELECT object&
CASE radio_lstbox&
help_str$=""
CASE checl_lstbox&
help_str$=""
CASE menu_lstbox&
help_str$=""
CASE open_listbox1&
help_str$=""
CASE open_lstbox2&
help_str$=""
CASE open_lstbox3&
help_str$=""
CASE lstbox_close&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE mstate&
SELECT object&
CASE mstate1&
help_str$=""
CASE mstate4&
help_str$=""
CASE mstate2&
help_str$=""
CASE mstate3&
help_str$=""
CASE mstate_close&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE other&
SELECT object&
CASE misc_drag&
help_str$=""
CASE misc_move&
help_str$=""
CASE misc_close&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE resize_me&
SELECT object&
CASE resize_close&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE foldable&
SELECT object&
CASE foldable_close&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE toolstrip&
SELECT object&
CASE sa_freqpop&
help_str$=""
CASE sa_zoompop&
help_str$=""
CASE toolstrip_open&
help_str$=""
CASE sa_play_dma&
help_str$=""
CASE toolstrip_save&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE toolbar&
SELECT object&
CASE toolbar_radios&
help_str$=""
CASE toolbar_sel&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE menu&
SELECT object&
CASE about&
help_str$=""
CASE demo_quit&
help_str$=""
CASE prg_modal&
help_str$=""
CASE non_modal&
help_str$=""
CASE toolbox_modal&
help_str$=""
CASE m_buttons&
help_str$=""
CASE m_status&
help_str$=""
CASE m_radios&
help_str$=""
CASE m_input&
help_str$=""
CASE m_popups&
help_str$=""
CASE m_listboxes&
help_str$=""
CASE m_multistate&
help_str$=""
CASE m_resize&
help_str$=""
CASE m_foldable&
help_str$=""
CASE m_other&
help_str$=""
CASE menu_ascii&
help_str$=""
CASE menu_alerts&
help_str$=""
CASE menu_progress&
help_str$=""
CASE menu_busy&
help_str$=""
CASE demo_simple_win&
help_str$=""
CASE demo_hor_tlstrip&
help_str$=""
CASE demo_ver_toolbar&
help_str$=""
CASE demo_menu_window&
help_str$=""
CASE iconify_all&
help_str$=""
CASE uniconify_all&
help_str$=""
CASE menu_help&
help_str$=""
CASE menu_gen_help&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE window_menu&
SELECT object&
CASE test&
help_str$=""
CASE font_selector&
help_str$=""
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE fvt_lsbx&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE fvt_prog&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE fvt_asci&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE fvt_altr&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE iconify_icon_1&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE fvt_work&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
CASE fvt_strt&
SELECT object&
ENDSELECT
'
' ----------------------------------------------------------------------------
ENDSELECT
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
' ----------------------------------------------------------------------------
IF help_str$=""
help_str$="There is no help available for this object" !***if no bubble help
ENDIF
RETURN help_str$
ENDFUNC
> PROCEDURE user_rsc_draw_extra(userhandle&,index&,tree&,tree%,cx&,cy&,cw&,ch&)
LOCAL x&,y&,w&,h&
~GRAF_MOUSE(256,0) !hidem - to avoid "mousedroppings"
'
' This procedure is here if you need to draw anything in the dialog that
' cannot be in the RSC-file. The clipping rectangle is already set
' for this procedure (walking the rectangle tree) MUST NOT BE ALTERED!!!
' Else you may find yourself drawing over other objects, or even windows!
'
' <userhandle&> is the userhandle you gave when opening the window
' or -1 if it is a dialog window
' <index&> is the index of this window in window_array&(index&,x)
' <tree&> is the object tree number of the dialog or toolstrip/bar
' <tree%> is the object tree adress of the dialog or toolstrip/bar
' <cx&>,<cy&>,<cw&>,<ch&> is the clipping rectangle set
'
' You should limit your drawing/blitting commands to the size and
' location of an IBOX/BOX object. The BOX will give you a backround,
' the IBOX will not. The location and width/height of the IBOX/BOX
' are found by calling:
'
' @rsc_ob_xywh(tree%,object&,x&,y&,w&,h&)
'
' <tree%> is the object tree adress
' <object&> is the object number
' <x&> is the x-coordinate
' <y&> is the y-coordinate
' <w&> is the width
' <h&> is the height
'
' So you might set up a SELECT/CASE structure that looks
' something like this example:
'
' SELECT tree&
' CASE dialog_1&
' @rsc_ob_xywh(tree%,help2&,x&,y&,w&,h&)
' DEFFILL 1,2,5
' PBOX x&,y&,PRED(ADD(x&,w&)),PRED(ADD(y&,h&))
' CASE toolstrip_h&
' @rsc_ob_xywh(tree%,t_clip&,x&,y&,w&,h&)
' DEFFILL 1,2,5
' PBOX x&,y&,PRED(ADD(x&,w&)),PRED(ADD(y&,h&))
' ENDSELECT
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
~GRAF_MOUSE(257,0) !showm - display pointer again
RETURN
> PROCEDURE user_on_exit
'
' This procedure is called when you exit the program. If you need to
' release memory, restore the original desktop or do other
' "cleaning up" tasks, do it here.
'
' If run as an accessory, this procedure is called EVERY TIME
' THE ACCESSORY IS CLOSED. (Remember: An accessory is NEVER exited)
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
@viewer_close !ΩΩFVW:fileviewerΩΩ
@messagewin_close !ΩΩFVW:messagewinΩΩ
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
RETURN
> FUNCTION user_quit_ok
$F%
exit_program!=FALSE
IF acc!
RETURN TRUE
ELSE
'
' User wants to quit
' Return value: TRUE to quit
' FALSE to ignore
'
' The following SELECT-CASE-ENDSELECT structure is just an example.
' If you want to use an alert, you may (should?:-) want to use
' a windowed alert...
'
' The rest of the code in this function should *NOT* be altered!
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
SELECT FORM_ALERT(1,"[1][Really quit? ][ OK |Cancel]")
CASE 1
RETURN TRUE
CASE 2
RETURN FALSE
ENDSELECT
'
ENDIF
ENDFUNC
> FUNCTION user_systemcheck
$F%
'
' This function is called immediately when the program is started,
' and only if the requirements in the system procedure 'SYSTEMCHECK'
' is met. Remember: The RSC is NOT YET LOADED! If you need to check
' anything special (like a cookie) before allowing the program to load
' and run, do it here.
'
' To continue, return TRUE
' To abort the program, return FALSE
'
' If you abort the program, use an alert to tell the user WHY the program
' is aborted.
'
' If you have no need to check anything, just leave this function empty,
' except of course for the 'RETURN TRUE' line below.
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
RETURN TRUE
ENDFUNC
> PROCEDURE user_gem_messages(mx&,my&,ks&,m0&,m1&,m2&,m3&,m4&,m5&,m6&,m7&)
'
' Any message the Face Value engine do not understand, goes to this proc.
' Here, you are free to implement your own communication protocols, or
' to ignore unknown messages completly and leave it empty.
'
' <mx&> and <my&> are the mouse coordinates at the time of the message
' <ks&> is the keyboard state at the time of the message
' <m0&> to <m7&> are the actual words in the message
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
RETURN
> PROCEDURE user_mouse(handle&,userhandle&,index&,mx&,my&,mc&,mb&,ks&)
LOCAL x&,y&,w&,h&
'
' If the user clicks in the work area of a userwindow
' with the mouse, this procedure is called. The mouse-coordinates
' are screen coordinates. There is no reason to check if the mouse is
' inside the work area of the window, this procedure would not be called
' otherwise.
'
' To get the true work area of this window, you call:
'
@win_get_workarea(index&,x&,y&,w&,h&)
'
' <x&>,<y&>,<w&> and <h&> are x,y,width and height for the work area
' of the window.
'
' <handle&> is the GEM handle of the window
' <userhandle&> is the userhandle you gave when opening the window
' <index&> is the index of this window in window_array&(index&,x)
' <mx&> is the x-mouseposition
' <my&> is the y-mouseposition
' <mc&> is the number of clicks (1=normal/2=double clicked)
' <mb&> is the mousebutton that was clicked (1=left/2=right)
' <ks&> is the keyboard state when the mouse was clicked, thus:
' IF AND(ks&,&X11): shift key pressed (either one)
' IF BTST(ks&,2) : control key pressed
' IF BTST(ks&,3) : alternate key pressed
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' --------------------------------------------------------------------------- !ΩΩFVW:textlistΩΩ
' Textlist-Wrinkle: (©1997 by Holger Herzog) !ΩΩFVW:textlistΩΩ
' !ΩΩFVW:textlistΩΩ
' Call textlist_click to handle mouseclicks in textlist-userwindows. !ΩΩFVW:textlistΩΩ
' !ΩΩFVW:textlistΩΩ
' LOCAL dd! !ΩΩFVW:textlistΩΩ
' SELECT userhandle& !ΩΩFVW:textlistΩΩ
' CASE xxx !ΩΩFVW:textlistΩΩ
' LET dd!=TRUE ! allow drag&drop !ΩΩFVW:textlistΩΩ
' LET selected&=@textlist_click(index&,mx&,my&,mb&,ks&,mc&,dd!,num%,selected!(),hash&()) !ΩΩFVW:textlistΩΩ
' IF selected&=>0 !ΩΩFVW:textlistΩΩ
' ' Doubleclick! !ΩΩFVW:textlistΩΩ
' ENDIF !ΩΩFVW:textlistΩΩ
' ENDSELECT !ΩΩFVW:textlistΩΩ
' !ΩΩFVW:textlistΩΩ
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
RETURN
> FUNCTION user_dragdrop_init(handle&,userhandle&,index&,x&,y&,ks&,VAR datatypes$)
$F%
'
' A drag & drop protocol is initiated. Your program is the recipient.
' The variables have the following meaning:
'
' <handle&> is the GEM handle of the targeted window
' <userhandle&> is the userhandle you gave when opening the window if
' this is a userwindow. If it is not, <userhandle&> will
' be -1
' <index&> is the index of this window in window_array&(index&,x)
' <x&> is the x-mouseposition when the object was dropped on your window
' <y&> is the y-mouseposition when the object was dropped on your window
' <ks&> is the keyboard state when the object was dropped on your window:
' IF AND(ks&,&X11): shift key pressed (either one)
' IF BTST(ks&,2) : control key pressed
' IF BTST(ks&,3) : alternate key pressed
'
' <datatypes$> is a variable that is sent back to the routine performing
' the drag & drop. It should be filled with 4-byte extenders
' of the filetypes you can recieve for this window. An
' example: ".IMG.TXT.ASC" Note that the extenders should
' be preceeded by a "." There must NOT be more than 8
' extenders (32 bytes) There are two special extendertypes:
'
' "ARGS" - Standard commandline. Note there is no preceeding "."
' Used by the desktop when files are dragged to an
' application's window. Could be more than 1 filename.
'
' "PATH" - The window has a path connected to it (a document
' window), and can SEND this to the other application.
' No preceeding "." here, either.
'
' IMPORTANT: <datatypes$> should NOT exceed 32 bytes in lenght. It should
' NOT be left empty, unless you want to cancel the drag & drop
' session.
'
' To continue the drag & drop protocol, return 0. To cancel, return 1.
' IMPORTANT: THIS IS THE ONLY RETURN VALUES ALLOWED!!!
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
IF userhandle&=viewer_userhandle_& !ΩΩFVW:fileviewerΩΩ
IF viewer_dragdrop_! !ΩΩFVW:fileviewerΩΩ
LET datatypes$=".TXT.ASCARGS" !ΩΩFVW:fileviewerΩΩ
RETURN 0 !ΩΩFVW:fileviewerΩΩ
ELSE !ΩΩFVW:fileviewerΩΩ
RETURN 1 !ΩΩFVW:fileviewerΩΩ
ENDIF !ΩΩFVW:fileviewerΩΩ
ENDIF !ΩΩFVW:fileviewerΩΩ
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
RETURN 1
'
ENDFUNC
> FUNCTION user_dragdrop_path(handle&,userhandle&,index&,x&,y&,ks&,size%,VAR path$)
$F%
'
' This function is called when another application requests the path
' to the window in <handle&>
'
' The variables have the following meaning:
'
' <handle&> is the GEM handle of the targeted window
' <userhandle&> is the userhandle you gave when opening the window if
' this is a userwindow. If it is not, <userhandle&> will
' be -1
' <index&> is the index of this window in window_array&(index&,x)
' <x&> is the x-mouseposition when the object was dropped on your window
' <y&> is the y-mouseposition when the object was dropped on your window
' <ks&> is the keyboard state when the object was dropped on your window:
' IF AND(ks&,&X11): shift key pressed (either one)
' IF BTST(ks&,2) : control key pressed
' IF BTST(ks&,3) : alternate key pressed
'
' <size%> is the maximum lenght of the path that can be returned
'
' <path$> is a variable that is sent back to the routine performing
' the drag & drop. It should be filled the path connected
' to the window.
'
' IMPORTANT: <path$> should NOT exceed <size%> bytes in lenght. It should
' NOT be left empty, unless you cancel the drag & drop session
' and return 1
'
' To return the path to the application that requested it, return 0.
' To cancel, return 1.
'
' IMPORTANT: THIS IS THE ONLY RETURN VALUES ALLOWED!!!
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
RETURN 1
'
ENDFUNC
> FUNCTION user_dragdrop_accept(handle&,userhandle&,index&,x&,y&,ks&,type$,id$,file$,size%)
$F%
'
' An application wants to send data to your application.
'
' The variables have the following meaning:
'
' <handle&> is the GEM handle of the targeted window
' <userhandle&> is the userhandle you gave when opening the window if
' this is a userwindow. If it is not, <userhandle&> will
' be -1
' <index&> is the index of this window in window_array&(index&,x)
' <x&> is the x-mouseposition when the object was dropped on your window
' <y&> is the y-mouseposition when the object was dropped on your window
' <ks&> is the keyboard state when the object was dropped on your window:
' IF AND(ks&,&X11): shift key pressed (either one)
' IF BTST(ks&,2) : control key pressed
' IF BTST(ks&,3) : alternate key pressed
'
' <type$> is the type of data (4 bytes long, ex: ".IMG", ".TXT" etc).
' <id$> is the datas name (not its filename)
' <file$> is the filename the data is associated to (if any)
' <size%> is the length in bytes of the data the sending application has
' dropped on your window.
'
'
' RETURN VALUES:
' 0 = Accept. the procedure @user_dragdrop_loaddata() will be called
' and the data can be loaded there.
' 1 = Abort
' 2 = Unacceptable format of the data. Try again.
' 3 = Too much data. Try again.
' 4 = Data has been dropped on a trashcan and the sending application should
' delete this data.
' 5 = Data has been dropped on a printer and the sending application should
' print this data.
' 6 = Data has been dropped on a clipboard and the sending application should
' copy the data to the clipboard this data.
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
IF userhandle&=viewer_userhandle_& !ΩΩFVW:fileviewerΩΩ
IF viewer_dragdrop_! !ΩΩFVW:fileviewerΩΩ
SELECT type$ !ΩΩFVW:fileviewerΩΩ
CASE ".TXT",".ASC","ARGS" !ΩΩFVW:fileviewerΩΩ
RETURN 0 !ΩΩFVW:fileviewerΩΩ
DEFAULT !ΩΩFVW:fileviewerΩΩ
RETURN 2 !ΩΩFVW:fileviewerΩΩ
ENDSELECT !ΩΩFVW:fileviewerΩΩ
ELSE !ΩΩFVW:fileviewerΩΩ
RETURN 1 !ΩΩFVW:fileviewerΩΩ
ENDIF !ΩΩFVW:fileviewerΩΩ
ENDIF !ΩΩFVW:fileviewerΩΩ
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
RETURN 1
'
ENDFUNC
> PROCEDURE user_dragdrop_loaddata(handle&,userhandle&,index&,x&,y&,ks&,type$,id$,file$,size%,f_handle&)
'
' Now you can load the data from the drag & drop session.
'
' The variables have the following meaning:
'
' <handle&> is the GEM handle of the targeted window
' <userhandle&> is the userhandle you gave when opening the window if
' this is a userwindow. If it is not, <userhandle&> will
' be -1
' <index&> is the index of this window in window_array&(index&,x)
' <x&> is the x-mouseposition when the object was dropped on your window
' <y&> is the y-mouseposition when the object was dropped on your window
' <ks&> is the keyboard state when the object was dropped on your window:
' IF AND(ks&,&X11): shift key pressed (either one)
' IF BTST(ks&,2) : control key pressed
' IF BTST(ks&,3) : alternate key pressed
'
' <type$> is the type of data (4 bytes long, ex: ".IMG", ".TXT" etc).
' <id$> is the datas name (not its filename)
' <file$> is the filename the data is associated to (if any)
' <size%> is the length in bytes of the data the sending application has
' dropped on your window.
' <f_handle&> is the FILEhandle that should be used to read the data. The
' file is already open, and will be closed when you exit this
' procedure. To read, you *MUST* use:
'
' return%=@fread(f_handle&,adr%,size%)
'
' <adr%> is the adress to load the data into.
' If <return%> is negative, an error occured.
'
' ΩΩwsnippetΩΩ - Wrinkle code: (don't change or delete this flag)
' ΩΩwsnippetΩΩ - End of Wrinkle code: (don't change or delete this flag)
'
RETURN